Skip to main content

Write a plist file (plist.write)

Declaration​

plist.write(filePath, tab)

Parameters​

  • filePath
    String. Absolute path of the plist file to write.
  • tab
    Table. The table (tree) to be converted to plist and written.

Description​

Write a Lua table (tree) to a plist file.
This function can be used in XUI.

Example​

local plfilename = "/var/mobile/Library/Caches/com.apple.mobile.installation.plist"
local tmp2 = plist.read(plfilename)
tmp2["Metadata"]["ProductBuildVersion"] = "CustomBuild"
plist.write(plfilename, tmp2)
sys.chown(plfilename, 501, 501) -- fix ownership
sys.chmod(plfilename, "0644") -- fix permission